class OliveHUD extends MobileHud;

simulated event PostBeginPlay()
{
	super.PostBeginPlay();
	SizeX = OlivePC(PlayerOwner).ViewportSize.X;
	SizeY = OlivePC(PlayerOwner).ViewportSize.Y;
}

function DrawHUD()
{

}

function bool PointIsWithin(Vector2D point, float Left, float Top, float XL, float YL)
{
	if (point.X >= Left && point.X <= Left + XL &&  point.Y >= Top && point.Y <= Top + YL) 
		return true;

	return false;
}

//return true to announce any hud object already clicked
function bool ProcessHudClick(Vector2D point)
{
	if (PointIsWithin(point, 0, 0, 100, 100))
	{
		TriggerGlobalEventClass(class'SeqEvent_OliveHudInput', self, 0 );
		OliveCamera(OlivePC(PlayerOwner).PlayerCamera).ResetCameraToCenter();
		return true;
	}
	else if (PointIsWithin(point, 150, 0, 100, 100))
	{
		TriggerGlobalEventClass(class'SeqEvent_OliveHudInput', self, 1 );
		return true;
	}
	else if (PointIsWithin(point, 300, 0, 100, 100))
	{
		TriggerGlobalEventClass(class'SeqEvent_OliveHudInput', self, 2 );
		OlivePC(PlayerOwner).SetGameInputType(OIT_SpawnLight);
		return true;
	}
	else if (PointIsWithin(point, 924, 668, 100, 100))
	{
		OliveCamera(OlivePC(PlayerOwner).PlayerCamera).ResetCameraToCenter();
		return true;
	}
	else if (PointIsWithin(point, 0, 668, 100, 100))
	{
		TriggerGlobalEventClass(class'SeqEvent_OliveHudInput', self, 3 );
		OlivePC(PlayerOwner).SpawnTouchBomb();
		OlivePC(PlayerOwner).SetGameInputType(OIT_SpawnBomb);
		return true;
	}

	return false;
}

function PostRender()
{
	Canvas.SetPos(0, 0, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 85, 33, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);

	Canvas.SetPos(150, 0, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 436, 36, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);

	Canvas.SetPos(300, 0, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 778, 32, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);

	Canvas.SetPos(0, 668, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 85, 828, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);

	Canvas.SetPos(924, 668, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 448, 828, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);

	Canvas.SetPos(924, 0, 0);
	Canvas.DrawTile(Texture2D'olive.UI.UI', 100, 100, 802, 834, 158, 158, MakeLinearColor(1, 1, 1, 1), false, BLEND_AlphaComposite);
}

DefaultProperties
{
}
